package com.xcity.pomelo.response;

import java.util.List;

import com.xcity.db.entity.Player;
import com.xcity.game.common.GameStaticConfig;
import com.xcity.game.common.PlayerPool;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class EmployeeRecruiteInfoResponse extends Response{
	//金币
	public int moneyLeftFreeCount;//金币剩余免费次数
	public int moneyFreeCount;//金币免费总次数
	
	public int moneyCost1;//金币单抽金额
	public int moneyLeftRollCount1;//金币单抽剩余次数
	public int moneyRollCount1;//金币单抽总次数
	
	public int moneyCost10;//金币十抽金额
	public int moneyLeftRollCount10;//金币十抽剩余次数
	public int moneyRollCount10;//金币十抽总次数
	
	public int moneyCost100;//金币百抽金额
	public int moneyLeftRollCount100;//金币百抽剩余次数
	public int moneyRollCount100;//金币百抽总次数
	
	//钻石
	public int stoneLeftFreeCount;//钻石剩余免费次数
	public int stoneFreeCount;//钻石免费总次数
	public int stoneNext;//钻石X次后必得
	public int stoneLeftHalfCount;//钻石半价剩余次数
	public int stoneCost1;//钻石单抽价格
	public int stoneCost10;//钻石十抽价格
	public int stoneHalf10;//钻石10抽半价 0:有半价  1:无半价
	
	public List<Integer> goldList; // 现金招聘产出物品id数组
	public List<Integer> stoneList; // 钻石招聘产出物品id数组
	public List<Integer> bookList; // 简历招聘产出物品id数组
	
	public int stoneCost1Half; // 钻石单抽折扣价
	
	
	public EmployeeRecruiteInfoResponse(int serial, Player player, List<Integer> _goldList, List<Integer> _stoneList, List<Integer> _bookList, int stoneCount) {
		super(serial);
		//金币
		int count = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_MONEY_FREE_COUNT, 0);
		this.moneyFreeCount = GameStaticConfig.recruitMoneyFreeCount;
		this.moneyLeftFreeCount = this.moneyFreeCount - count;
		if(this.moneyLeftFreeCount < 0){
			this.moneyLeftFreeCount = 0;
		}
		
		
		this.moneyCost1 = GameStaticConfig.recruitCostMoneyOne;
		int todayCount = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_MONEY_ONE_COUNT, 0);
		this.moneyRollCount1 = GameStaticConfig.recruitMoneyCountLimit1;
		this.moneyLeftRollCount1 = this.moneyRollCount1 - todayCount;
		if(this.moneyLeftRollCount1 < 0){
			this.moneyLeftRollCount1 = 0;
		}
		this.moneyCost10 = GameStaticConfig.recruitCostMoneyTen;
		todayCount = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_MONEY_TEN_COUNT, 0);
		this.moneyRollCount10 = GameStaticConfig.recruitMoneyCountLimit10;
		this.moneyLeftRollCount10 = this.moneyRollCount10 - todayCount;
		if(this.moneyLeftRollCount10 < 0){
			this.moneyLeftRollCount10 = 0;
		}
		this.moneyCost100 = GameStaticConfig.recruitCostMoneyHundred;
		todayCount = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_MONEY_HUNDRED_COUNT, 0);
		this.moneyRollCount100 = GameStaticConfig.recruitMoneyCountLimit100;
		this.moneyLeftRollCount100 = this.moneyRollCount100 - todayCount;
		if(this.moneyLeftRollCount100 < 0){
			this.moneyLeftRollCount100 = 0;
		}
		
		//钻石
		count = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_STONE_FREE_COUNT, 0);
		this.stoneFreeCount = GameStaticConfig.recruitStoneFreeCount;
		this.stoneLeftFreeCount = this.stoneFreeCount - count;
		if(this.stoneLeftFreeCount < 0){
			this.stoneLeftFreeCount = 0;
		}
		this.stoneNext = 10 - (player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_STONE_RECRUIT_COUNT, 0) % 10);
		if(stoneCount > -1){
			this.stoneNext = stoneCount;
		}
		count = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_STONE_HALF_COUNT, 0);
		if(count == 0){
			this.stoneLeftHalfCount = 1;
		}
		this.stoneCost1 = GameStaticConfig.recruitCostStoneOne;
		this.stoneCost1Half = GameStaticConfig.recruitCostStoneOne * GameStaticConfig.recruitStoneDiscount / 10;
		this.stoneHalf10 = player.getPool().getInt(PlayerPool.PROPERTY_EMPLOYEE_FIRST_TEN, 0);
		this.stoneCost10 = GameStaticConfig.recruitCostStoneTen;
		if(stoneHalf10 == 0){
			this.stoneCost10 = this.stoneCost10 >> 1;
		}
		
		this.goldList = _goldList;
		this.stoneList = _stoneList;
		this.bookList = _bookList;
	}
}
